<B:UIVKPOS x:Class="WPFExcelReport.TSJHVK02"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
    xmlns:UserControls="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Controls"
    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
    xmlns:VK="clr-namespace:WPFExcelReport;assembly=TVKKOPF"
     xmlns:B="clr-namespace:WPFExcelReport;assembly=TVKPOS"
    xmlns:me="clr-namespace:WPFExcelReport"
    xmlns:KD="clr-namespace:WPFExcelReport;assembly=TKDSTAMM"   
    xmlns:KA="clr-namespace:WPFExcelReport;assembly=TKDANSP"
    xmlns:VAK="clr-namespace:WPFExcelReport;assembly=TVAKOLL" 
      xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"   
    xmlns:VF="clr-namespace:WPFExcelReport;assembly=TVAFARBEN"
    xmlns:ChartEx="clr-namespace:WPFExcelReport.Chart;assembly=ITXVIEWS"
     x:Name="TV"
    Loaded="Window_Loaded"
 >
    <B:UIVKPOS.Resources>
        <CollectionViewSource   x:Key="vwMaster" />
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:TextTrimmingConverter  x:Key="trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </B:UIVKPOS.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="1*" />
            <RowDefinition   Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition  Width="1*" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0"  >
            <StackPanel  >
                <WrapPanel >
                    <Grid >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button Grid.Column="0" Height="20"  Width="24" Margin="0,0,0,0" Click="PrintCommand" >
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Print.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock Grid.Column="1" 
                                   Text="{Binding Source={Localization:Translate Word=打印}}"></TextBlock>
                    </Grid>
                    <B:TSACHBE SACHBE="{Binding SACHBE,ElementName=TV}"  Margin="10,0,0,0"
                                IsEdit="True"
                                MinWidth="100"/>
                    <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=客户:}}" Margin="10,0,0,0"/>
                    <!--<KD:TSKD02 KEY="{Binding KUNDNR,ElementName=TV}"
                               IsEdit="True"
                               MinWidth="100"/>-->
                    <KD:TSKD02 Grid.Column="0" MinWidth="100"  IsEdit="True"  
                               Name="cKD02"
                               KEY="{Binding Path=KUNDNR,ElementName=TV}" />
                    <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=类型:}}" Margin="10,0,0,0"/>
                    <SD:K8884  Grid.Column="2" KEY="{Binding AUFART,ElementName=TV}"  Width="100"
                               IsEdit="True"
                                ORDERNUM="{Binding AUFART,ElementName=TV }"/>
                    <Grid  Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=销售单}}"/>
                        <TextBox Grid.Column="1" Text="{Binding KRS,ElementName=TV}" Width="40"/>
                        <TextBox Grid.Column="2" Text="{Binding LFD,ElementName=TV}" Width="80"/>
                    </Grid>
                    <B:TKDKOMM KDKOMM="{Binding KDKOMM,ElementName=TV}" MinWidth="120" Visibility="Collapsed"  />
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=品种号：}}"/>
                        <TextBox Grid.Column="1" Text="{Binding ART,Converter={StaticResource gb2312},ElementName=TV}"  Width="150"/>
                    </Grid>
                </WrapPanel>
                <WrapPanel>

                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=订单交期:}}"/>
                        <TextBox Grid.Column="1" Text="{Binding DTSTART,ElementName=TV}"  Width="80"/>
                    </Grid>
                    <Grid >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=-}}"/>
                        <TextBox Grid.Column="1" Text="{Binding DTEND,ElementName=TV}"  Width="80"/>
                    </Grid>
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=录单日期:}}"/>
                        <TextBox Grid.Column="1" Text="{Binding NEUDATS,ElementName=TV}"  Width="80"/>
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=-}}"/>
                        <TextBox Grid.Column="1" Text="{Binding NEUDATE,ElementName=TV}"  Width="80"/>
                    </Grid>

                    <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=季节}}"/>

                    <VAK:TSVA02  Grid.Column="1"  KEY="{Binding KOLL,ElementName=TV}" 
                               ORDERNUM="{Binding KOLL,ElementName=TV}" 
                             Width="AUTO" />
                    <!--<TextBox Grid.Column="2" Text="{Binding KOLL,ElementName=TV}" Width="60"/>-->
                    <TextBlock Grid.Column="3" Text="{Binding Source={Localization:Translate Word=客户联系人}}"/>
                    <KA:TSKD14 Grid.Column="4" Name="cSKD14"
                               IsEdit="True" Width="AUTO"
                                    KUNDNR="{Binding KUNDNR,ElementName=TV}"
                                    KEY="{Binding VKKANSPRECH,ElementName=TV}"  
                                    ORDERNUM="{Binding VKKANSPRECH,ElementName=TV}"  
                                />
                    <!--<TextBox Grid.Column="4" Text="{Binding CART,Converter={StaticResource gb2312},ElementName=TV}" Width="60"/>-->
                    <Button Grid.Column="5" Height="20"  Width="24" Margin="10,0,0,0" Click="QueryCommand" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Grid.Column="6" Text="{Binding Source={Localization:Translate Word=查询}}"/>
                    <Button Grid.Column="5" Height="20"  Margin="10,0,0,0" Click="ZYQueryCommand" Content="{Binding Source={Localization:Translate Word=自营}}"/>
                    <Button  Grid.Column="7"  Content="{Binding Source={Localization:Translate Word=导出}}" Height="20" Margin="10,0,0,0"   Width="50" Panel.ZIndex="10"
                    Click="PrintCommand"   />  
                </WrapPanel>
            </StackPanel>
            <me:TERLVKP ORDERNUM="{Binding KEY,ElementName=TV}"/>
            <VK:TVK04 ORDERNUM="{Binding Path=AUF,ElementName=TV}" Visibility="Collapsed"/>
            <me:TFVK05 Grid.Row="1"  x:Name="cVKP"  
                      BSTSTA="{Binding Path=BSTSTA,ElementName=TV}" 
                       WAEHRSL="{Binding Path=WAEHRSL,ElementName=TV}" 
                          MinWidth="200" MinHeight="50" />
        </StackPanel>
        <DataGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,5,0,0"
                  AutoGenerateColumns="False" 
                  EnableRowVirtualization="False" 
                  Name="dlgMaster"
                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster }}" 
                  HeadersVisibility="Column"  CanUserReorderColumns="True" CanUserResizeRows="True"  
                  RowDetailsVisibilityMode="VisibleWhenSelected"
                  Width="Auto" Height="Auto" 
                  EnableColumnVirtualization="True" 
                  HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=VKPSA}" Header="{Binding Source={Localization:Translate Word=有效}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=KDKUNDNA, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=客户}}"   Width="Auto"  MinWidth="40"/>
                <DataGridTextColumn Binding="{Binding Path=VKKANSPRECH, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=联系人}}"   Width="Auto"  MinWidth="40"/>
                <DataGridTextColumn Binding="{Binding Path=VKPAUFKRS}" Header="" Width="Auto" MinWidth="24" />
                <DataGridTextColumn Binding="{Binding Path=VKPAUFLFD}" Header="{Binding Source={Localization:Translate Word=销售单}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPAUFPOS}" Header=" " Width="Auto"  />
                 <DataGridTextColumn Binding="{Binding Path=VKPKOLL}" Header="{Binding Source={Localization:Translate Word=季节}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPART}" Header="{Binding Source={Localization:Translate Word=面料}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPFARBE, Converter={StaticResource ResourceKey=trim}}" Header="{Binding Source={Localization:Translate Word=色号}}" Width="Auto"   />
                <DataGridTextColumn Binding="{Binding Path=VKPMENGE1, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=数量}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VKPRESERV, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=预留}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=VKPZUGET, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=留位}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VKPFREIGE, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=确认}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=VKPVERS, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=发货}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=VKPFAKT, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=开票}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=VKPWUTERM}" Header="{Binding Source={Localization:Translate Word=客户请求}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPLIEFTERM}" Header="{Binding Source={Localization:Translate Word=交期}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=DELDAT}" Header="{Binding Source={Localization:Translate Word=最后出货日期}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPPREIS, Converter={StaticResource ResourceKey=d1000}}" Header="{Binding Source={Localization:Translate Word=单价}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=TOTVALUE}" Header="{Binding Source={Localization:Translate Word=总金额}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=SUR}" Header="{Binding Source={Localization:Translate Word=附加}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=SUR1}" Header="{Binding Source={Localization:Translate Word=样布}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=SUR2}" Header="{Binding Source={Localization:Translate Word=快递}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=SUR3}" Header="{Binding Source={Localization:Translate Word=制版}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=DIS}" Header="{Binding Source={Localization:Translate Word=折扣}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=VKKHWAEHRSL}" Header="{Binding Source={Localization:Translate Word=货币}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=VKKZAHLBED}" Header="{Binding Source={Localization:Translate Word=付款方式}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=VKKLIEFBED}" Header="{Binding Source={Localization:Translate Word=贸易方式}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=VKKVERSART}" Header="{Binding Source={Localization:Translate Word=运输方式}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=VKKSPED}" Header="{Binding Source={Localization:Translate Word=承运人}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=VKKVG, Converter={StaticResource ResourceKey=trim}}" Header="{Binding Source={Localization:Translate Word=税}}"   Width="Auto"  MinWidth="40"/>
                <DataGridTextColumn Binding="{Binding Path=VAAFILLER, Converter={StaticResource ResourceKey=trim}}" Header="{Binding Source={Localization:Translate Word=成份}}"   Width="Auto"  MinWidth="40"/>
                <DataGridTextColumn Binding="{Binding Path=VKPKDFARBNR, Converter={StaticResource ResourceKey=trim}}" Header="{Binding Source={Localization:Translate Word=客人色号}}" Width="Auto" MinWidth="100"/>
                <DataGridTextColumn Binding="{Binding Path=VKKBESTNR}" Header="{Binding Source={Localization:Translate Word=申购单}}"  Width="Auto" MinWidth="40"/>
                <DataGridTextColumn Binding="{Binding Path=VAAPRGR}" Header="{Binding Source={Localization:Translate Word=产品组}}"   Width="Auto"  MinWidth="24"/>
                <DataGridTextColumn Binding="{Binding Path=VAAARTGRP}" Header="{Binding Source={Localization:Translate Word=产品组}}"   Width="Auto"  MinWidth="24"/>
                <DataGridTextColumn Binding="{Binding Path=VKPNEUDAT}" Header="{Binding Source={Localization:Translate Word=创建日期}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPNEUBEN}" Header="{Binding Source={Localization:Translate Word=跟单}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPSACHBE}" Header="{Binding Source={Localization:Translate Word=负责人}}" Width="Auto" MinWidth="30" />
            </DataGrid.Columns>
        </DataGrid>
        <WrapPanel Grid.Row="2" >
            <TextBlock Text="{Binding TKEY1}"  Margin="10,0,0,0"></TextBlock>
            <TextBlock Text="{Binding SUM1,Converter={StaticResource d100}}" Foreground="Red" Margin="10,0,0,0"></TextBlock>
            <TextBlock Text="{Binding TKEY2}"   Margin="10,0,0,0"></TextBlock>
            <TextBlock Text="{Binding SUM2}" Foreground="Red" Margin="10,0,0,0"></TextBlock>
            <TextBlock Text="{Binding TKEY3}"   Margin="10,0,0,0"></TextBlock>
            <TextBlock Text="{Binding SUM3}" Foreground="Red" Margin="10,0,0,0"></TextBlock>
            <TextBlock Text="{Binding TCOUNT1}"   Margin="10,0,0,0"></TextBlock>
            <TextBlock Text="{Binding Counts}" Foreground="Red" Margin="20,0,0,0"></TextBlock>
        </WrapPanel>
    </Grid>
</B:UIVKPOS>
